package sortie;

import echecs.APiece;

import echecs.Case;
import echecs.Couleur;
import echecs.Coups;
import echecs.Position;
import java.awt.event.MouseEvent;
import java.net.URL;
import javax.swing.ImageIcon;
import echecs.Generateur;

import iechecs.type.Liste;
import java.awt.Color;
import java.util.Iterator;
import java.util.Map.Entry;
import javax.swing.JLabel;

/**
 *
 * @author Gilles
 */
public class VueEchiquier extends javax.swing.JFrame
{

    private static final long serialVersionUID = -6038868081772733029L;
    private URL wrb,  wnw,  wbb,  wnb,  wqb,  wqw,  wrw,  wbw,  wpw,  wpb,  wkw,  wkb,  brb,  brw,  bnw,  bnb,  bbb,  bbw,  bqb,  bpw,  bpb,  bkw,  bkb,  bqw;
    private URL W,  B;
    /**
     *
     */
    public static Color jlblack = new java.awt.Color(136, 136, 153);
    /**
     *
     */
    public static Color jlwhite = new java.awt.Color(255, 255, 255);
    private Generateur gen;
    private Position position;
    private Iterator<Entry<APiece, Case>> itPiece;
    private JLabel jlabel;

    /**
     *
     * @param gen
     */
    public VueEchiquier(Generateur gen)
    {
        this.gen = gen;
        initComponents();
        initialiserURL();
//        positionInitiale();
        setVisible(true);// avant toGui() !!!
        position = gen.getPosition();

        toGui();
        itPiece = position.getPos_courante().iterator();
    }

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        echiquierpanel = new javax.swing.JPanel();
        a8 = new javax.swing.JLabel();
        b8 = new javax.swing.JLabel();
        c8 = new javax.swing.JLabel();
        d8 = new javax.swing.JLabel();
        e8 = new javax.swing.JLabel();
        f8 = new javax.swing.JLabel();
        g8 = new javax.swing.JLabel();
        h8 = new javax.swing.JLabel();
        a7 = new javax.swing.JLabel();
        b7 = new javax.swing.JLabel();
        c7 = new javax.swing.JLabel();
        d7 = new javax.swing.JLabel();
        e7 = new javax.swing.JLabel();
        f7 = new javax.swing.JLabel();
        g7 = new javax.swing.JLabel();
        h7 = new javax.swing.JLabel();
        a6 = new javax.swing.JLabel();
        b6 = new javax.swing.JLabel();
        c6 = new javax.swing.JLabel();
        d6 = new javax.swing.JLabel();
        e6 = new javax.swing.JLabel();
        f6 = new javax.swing.JLabel();
        g6 = new javax.swing.JLabel();
        h6 = new javax.swing.JLabel();
        a5 = new javax.swing.JLabel();
        b5 = new javax.swing.JLabel();
        c5 = new javax.swing.JLabel();
        d5 = new javax.swing.JLabel();
        e5 = new javax.swing.JLabel();
        f5 = new javax.swing.JLabel();
        g5 = new javax.swing.JLabel();
        h5 = new javax.swing.JLabel();
        a4 = new javax.swing.JLabel();
        b4 = new javax.swing.JLabel();
        c4 = new javax.swing.JLabel();
        d4 = new javax.swing.JLabel();
        e4 = new javax.swing.JLabel();
        f4 = new javax.swing.JLabel();
        g4 = new javax.swing.JLabel();
        h4 = new javax.swing.JLabel();
        a3 = new javax.swing.JLabel();
        b3 = new javax.swing.JLabel();
        c3 = new javax.swing.JLabel();
        d3 = new javax.swing.JLabel();
        e3 = new javax.swing.JLabel();
        f3 = new javax.swing.JLabel();
        g3 = new javax.swing.JLabel();
        h3 = new javax.swing.JLabel();
        a2 = new javax.swing.JLabel();
        b2 = new javax.swing.JLabel();
        c2 = new javax.swing.JLabel();
        d2 = new javax.swing.JLabel();
        e2 = new javax.swing.JLabel();
        f2 = new javax.swing.JLabel();
        g2 = new javax.swing.JLabel();
        h2 = new javax.swing.JLabel();
        a1 = new javax.swing.JLabel();
        b1 = new javax.swing.JLabel();
        c1 = new javax.swing.JLabel();
        d1 = new javax.swing.JLabel();
        e1 = new javax.swing.JLabel();
        f1 = new javax.swing.JLabel();
        g1 = new javax.swing.JLabel();
        h1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        logbox = new javax.swing.JTextArea();
        a = new javax.swing.JLabel();
        rg1 = new javax.swing.JLabel();
        rg8 = new javax.swing.JLabel();
        h = new javax.swing.JLabel();
        Quit = new javax.swing.JButton();
        nextPiece = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Position");
        setBounds(new java.awt.Rectangle(200, 100, 600, 400));

        echiquierpanel.setBackground(new java.awt.Color(255, 255, 255));
        echiquierpanel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        echiquierpanel.setMaximumSize(new java.awt.Dimension(320, 320));
        echiquierpanel.setMinimumSize(new java.awt.Dimension(320, 320));
        echiquierpanel.setName("echiquier"); // NOI18N
        echiquierpanel.setPreferredSize(new java.awt.Dimension(320, 320));
        echiquierpanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                echiquierpanelMouseClicked(evt);
            }
        });
        echiquierpanel.setLayout(new java.awt.GridLayout(8, 8));

        a8.setBackground(new java.awt.Color(255, 255, 255));
        a8.setAlignmentY(0.0F);
        a8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a8.setDoubleBuffered(true);
        a8.setIconTextGap(0);
        a8.setMaximumSize(new java.awt.Dimension(40, 40));
        a8.setMinimumSize(new java.awt.Dimension(40, 40));
        a8.setName("a8"); // NOI18N
        a8.setOpaque(true);
        a8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a8);

        b8.setBackground(new java.awt.Color(136, 136, 153));
        b8.setAlignmentY(0.0F);
        b8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b8.setDoubleBuffered(true);
        b8.setIconTextGap(0);
        b8.setMaximumSize(new java.awt.Dimension(40, 40));
        b8.setMinimumSize(new java.awt.Dimension(40, 40));
        b8.setName("b8"); // NOI18N
        b8.setOpaque(true);
        b8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b8);

        c8.setBackground(new java.awt.Color(255, 255, 255));
        c8.setForeground(new java.awt.Color(136, 136, 153));
        c8.setAlignmentY(0.0F);
        c8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c8.setDoubleBuffered(true);
        c8.setIconTextGap(0);
        c8.setMaximumSize(new java.awt.Dimension(40, 40));
        c8.setMinimumSize(new java.awt.Dimension(40, 40));
        c8.setName("c8"); // NOI18N
        c8.setOpaque(true);
        c8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c8);

        d8.setBackground(new java.awt.Color(136, 136, 153));
        d8.setAlignmentY(0.0F);
        d8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d8.setDoubleBuffered(true);
        d8.setIconTextGap(0);
        d8.setMaximumSize(new java.awt.Dimension(40, 40));
        d8.setMinimumSize(new java.awt.Dimension(40, 40));
        d8.setName("d8"); // NOI18N
        d8.setOpaque(true);
        d8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d8);

        e8.setBackground(new java.awt.Color(255, 255, 255));
        e8.setAlignmentY(0.0F);
        e8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e8.setDoubleBuffered(true);
        e8.setIconTextGap(0);
        e8.setMaximumSize(new java.awt.Dimension(40, 40));
        e8.setMinimumSize(new java.awt.Dimension(40, 40));
        e8.setName("e8"); // NOI18N
        e8.setOpaque(true);
        e8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e8);

        f8.setBackground(new java.awt.Color(136, 136, 153));
        f8.setAlignmentY(0.0F);
        f8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f8.setDoubleBuffered(true);
        f8.setIconTextGap(0);
        f8.setMaximumSize(new java.awt.Dimension(40, 40));
        f8.setMinimumSize(new java.awt.Dimension(40, 40));
        f8.setName("f8"); // NOI18N
        f8.setOpaque(true);
        f8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f8);

        g8.setBackground(new java.awt.Color(255, 255, 255));
        g8.setAlignmentY(0.0F);
        g8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g8.setDoubleBuffered(true);
        g8.setIconTextGap(0);
        g8.setMaximumSize(new java.awt.Dimension(40, 40));
        g8.setMinimumSize(new java.awt.Dimension(40, 40));
        g8.setName("g8"); // NOI18N
        g8.setOpaque(true);
        g8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g8);

        h8.setBackground(new java.awt.Color(136, 136, 153));
        h8.setAlignmentY(0.0F);
        h8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h8.setDoubleBuffered(true);
        h8.setIconTextGap(0);
        h8.setMaximumSize(new java.awt.Dimension(40, 40));
        h8.setMinimumSize(new java.awt.Dimension(40, 40));
        h8.setName("h8"); // NOI18N
        h8.setOpaque(true);
        h8.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h8);

        a7.setBackground(new java.awt.Color(136, 136, 153));
        a7.setAlignmentY(0.0F);
        a7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a7.setDoubleBuffered(true);
        a7.setIconTextGap(0);
        a7.setMaximumSize(new java.awt.Dimension(40, 40));
        a7.setMinimumSize(new java.awt.Dimension(40, 40));
        a7.setOpaque(true);
        a7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a7);

        b7.setBackground(new java.awt.Color(255, 255, 255));
        b7.setAlignmentY(0.0F);
        b7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b7.setDoubleBuffered(true);
        b7.setIconTextGap(0);
        b7.setMaximumSize(new java.awt.Dimension(40, 40));
        b7.setMinimumSize(new java.awt.Dimension(40, 40));
        b7.setOpaque(true);
        b7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b7);

        c7.setBackground(new java.awt.Color(136, 136, 153));
        c7.setAlignmentY(0.0F);
        c7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c7.setDoubleBuffered(true);
        c7.setIconTextGap(0);
        c7.setMaximumSize(new java.awt.Dimension(40, 40));
        c7.setMinimumSize(new java.awt.Dimension(40, 40));
        c7.setOpaque(true);
        c7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c7);

        d7.setBackground(new java.awt.Color(255, 255, 255));
        d7.setAlignmentY(0.0F);
        d7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d7.setDoubleBuffered(true);
        d7.setIconTextGap(0);
        d7.setMaximumSize(new java.awt.Dimension(40, 40));
        d7.setMinimumSize(new java.awt.Dimension(40, 40));
        d7.setOpaque(true);
        d7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d7);

        e7.setBackground(new java.awt.Color(136, 136, 153));
        e7.setAlignmentY(0.0F);
        e7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e7.setDoubleBuffered(true);
        e7.setIconTextGap(0);
        e7.setMaximumSize(new java.awt.Dimension(40, 40));
        e7.setMinimumSize(new java.awt.Dimension(40, 40));
        e7.setOpaque(true);
        e7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e7);

        f7.setBackground(new java.awt.Color(255, 255, 255));
        f7.setAlignmentY(0.0F);
        f7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f7.setDoubleBuffered(true);
        f7.setIconTextGap(0);
        f7.setMaximumSize(new java.awt.Dimension(40, 40));
        f7.setMinimumSize(new java.awt.Dimension(40, 40));
        f7.setOpaque(true);
        f7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f7);

        g7.setBackground(new java.awt.Color(136, 136, 153));
        g7.setAlignmentY(0.0F);
        g7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g7.setDoubleBuffered(true);
        g7.setIconTextGap(0);
        g7.setMaximumSize(new java.awt.Dimension(40, 40));
        g7.setMinimumSize(new java.awt.Dimension(40, 40));
        g7.setOpaque(true);
        g7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g7);

        h7.setBackground(new java.awt.Color(255, 255, 255));
        h7.setAlignmentY(0.0F);
        h7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h7.setDoubleBuffered(true);
        h7.setIconTextGap(0);
        h7.setMaximumSize(new java.awt.Dimension(40, 40));
        h7.setMinimumSize(new java.awt.Dimension(40, 40));
        h7.setOpaque(true);
        h7.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h7);

        a6.setBackground(new java.awt.Color(255, 255, 255));
        a6.setAlignmentY(0.0F);
        a6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a6.setDoubleBuffered(true);
        a6.setIconTextGap(0);
        a6.setMaximumSize(new java.awt.Dimension(40, 40));
        a6.setMinimumSize(new java.awt.Dimension(40, 40));
        a6.setOpaque(true);
        a6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a6);

        b6.setBackground(new java.awt.Color(136, 136, 153));
        b6.setAlignmentY(0.0F);
        b6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b6.setDoubleBuffered(true);
        b6.setIconTextGap(0);
        b6.setMaximumSize(new java.awt.Dimension(40, 40));
        b6.setMinimumSize(new java.awt.Dimension(40, 40));
        b6.setOpaque(true);
        b6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b6);

        c6.setBackground(new java.awt.Color(255, 255, 255));
        c6.setAlignmentY(0.0F);
        c6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c6.setDoubleBuffered(true);
        c6.setIconTextGap(0);
        c6.setMaximumSize(new java.awt.Dimension(40, 40));
        c6.setMinimumSize(new java.awt.Dimension(40, 40));
        c6.setOpaque(true);
        c6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c6);

        d6.setBackground(new java.awt.Color(136, 136, 153));
        d6.setAlignmentY(0.0F);
        d6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d6.setDoubleBuffered(true);
        d6.setIconTextGap(0);
        d6.setMaximumSize(new java.awt.Dimension(40, 40));
        d6.setMinimumSize(new java.awt.Dimension(40, 40));
        d6.setOpaque(true);
        d6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d6);

        e6.setBackground(new java.awt.Color(255, 255, 255));
        e6.setAlignmentY(0.0F);
        e6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e6.setDoubleBuffered(true);
        e6.setIconTextGap(0);
        e6.setMaximumSize(new java.awt.Dimension(40, 40));
        e6.setMinimumSize(new java.awt.Dimension(40, 40));
        e6.setOpaque(true);
        e6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e6);

        f6.setBackground(new java.awt.Color(136, 136, 153));
        f6.setAlignmentY(0.0F);
        f6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f6.setDoubleBuffered(true);
        f6.setIconTextGap(0);
        f6.setMaximumSize(new java.awt.Dimension(40, 40));
        f6.setMinimumSize(new java.awt.Dimension(40, 40));
        f6.setOpaque(true);
        f6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f6);

        g6.setBackground(new java.awt.Color(255, 255, 255));
        g6.setAlignmentY(0.0F);
        g6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g6.setDoubleBuffered(true);
        g6.setIconTextGap(0);
        g6.setMaximumSize(new java.awt.Dimension(40, 40));
        g6.setMinimumSize(new java.awt.Dimension(40, 40));
        g6.setOpaque(true);
        g6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g6);

        h6.setBackground(new java.awt.Color(136, 136, 153));
        h6.setAlignmentY(0.0F);
        h6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h6.setDoubleBuffered(true);
        h6.setIconTextGap(0);
        h6.setMaximumSize(new java.awt.Dimension(40, 40));
        h6.setMinimumSize(new java.awt.Dimension(40, 40));
        h6.setOpaque(true);
        h6.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h6);

        a5.setBackground(new java.awt.Color(136, 136, 153));
        a5.setAlignmentY(0.0F);
        a5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a5.setDoubleBuffered(true);
        a5.setIconTextGap(0);
        a5.setMaximumSize(new java.awt.Dimension(40, 40));
        a5.setMinimumSize(new java.awt.Dimension(40, 40));
        a5.setOpaque(true);
        a5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a5);

        b5.setBackground(new java.awt.Color(255, 255, 255));
        b5.setAlignmentY(0.0F);
        b5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b5.setDoubleBuffered(true);
        b5.setIconTextGap(0);
        b5.setMaximumSize(new java.awt.Dimension(40, 40));
        b5.setMinimumSize(new java.awt.Dimension(40, 40));
        b5.setOpaque(true);
        b5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b5);

        c5.setBackground(new java.awt.Color(136, 136, 153));
        c5.setAlignmentY(0.0F);
        c5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c5.setDoubleBuffered(true);
        c5.setIconTextGap(0);
        c5.setMaximumSize(new java.awt.Dimension(40, 40));
        c5.setMinimumSize(new java.awt.Dimension(40, 40));
        c5.setOpaque(true);
        c5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c5);

        d5.setBackground(new java.awt.Color(255, 255, 255));
        d5.setAlignmentY(0.0F);
        d5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d5.setDoubleBuffered(true);
        d5.setIconTextGap(0);
        d5.setMaximumSize(new java.awt.Dimension(40, 40));
        d5.setMinimumSize(new java.awt.Dimension(40, 40));
        d5.setOpaque(true);
        d5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d5);

        e5.setBackground(new java.awt.Color(136, 136, 153));
        e5.setAlignmentY(0.0F);
        e5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e5.setDoubleBuffered(true);
        e5.setIconTextGap(0);
        e5.setMaximumSize(new java.awt.Dimension(40, 40));
        e5.setMinimumSize(new java.awt.Dimension(40, 40));
        e5.setOpaque(true);
        e5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e5);

        f5.setBackground(new java.awt.Color(255, 255, 255));
        f5.setAlignmentY(0.0F);
        f5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f5.setDoubleBuffered(true);
        f5.setIconTextGap(0);
        f5.setMaximumSize(new java.awt.Dimension(40, 40));
        f5.setMinimumSize(new java.awt.Dimension(40, 40));
        f5.setOpaque(true);
        f5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f5);

        g5.setBackground(new java.awt.Color(136, 136, 153));
        g5.setAlignmentY(0.0F);
        g5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g5.setDoubleBuffered(true);
        g5.setIconTextGap(0);
        g5.setMaximumSize(new java.awt.Dimension(40, 40));
        g5.setMinimumSize(new java.awt.Dimension(40, 40));
        g5.setOpaque(true);
        g5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g5);

        h5.setBackground(new java.awt.Color(255, 255, 255));
        h5.setAlignmentY(0.0F);
        h5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h5.setDoubleBuffered(true);
        h5.setIconTextGap(0);
        h5.setMaximumSize(new java.awt.Dimension(40, 40));
        h5.setMinimumSize(new java.awt.Dimension(40, 40));
        h5.setOpaque(true);
        h5.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h5);

        a4.setBackground(new java.awt.Color(255, 255, 255));
        a4.setAlignmentY(0.0F);
        a4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a4.setDoubleBuffered(true);
        a4.setIconTextGap(0);
        a4.setMaximumSize(new java.awt.Dimension(40, 40));
        a4.setMinimumSize(new java.awt.Dimension(40, 40));
        a4.setOpaque(true);
        a4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a4);

        b4.setBackground(new java.awt.Color(136, 136, 153));
        b4.setAlignmentY(0.0F);
        b4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b4.setDoubleBuffered(true);
        b4.setIconTextGap(0);
        b4.setMaximumSize(new java.awt.Dimension(40, 40));
        b4.setMinimumSize(new java.awt.Dimension(40, 40));
        b4.setOpaque(true);
        b4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b4);

        c4.setBackground(new java.awt.Color(255, 255, 255));
        c4.setAlignmentY(0.0F);
        c4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c4.setDoubleBuffered(true);
        c4.setIconTextGap(0);
        c4.setMaximumSize(new java.awt.Dimension(40, 40));
        c4.setMinimumSize(new java.awt.Dimension(40, 40));
        c4.setOpaque(true);
        c4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c4);

        d4.setBackground(new java.awt.Color(136, 136, 153));
        d4.setAlignmentY(0.0F);
        d4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d4.setDoubleBuffered(true);
        d4.setIconTextGap(0);
        d4.setMaximumSize(new java.awt.Dimension(40, 40));
        d4.setMinimumSize(new java.awt.Dimension(40, 40));
        d4.setOpaque(true);
        d4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d4);

        e4.setBackground(new java.awt.Color(255, 255, 255));
        e4.setAlignmentY(0.0F);
        e4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e4.setDoubleBuffered(true);
        e4.setIconTextGap(0);
        e4.setMaximumSize(new java.awt.Dimension(40, 40));
        e4.setMinimumSize(new java.awt.Dimension(40, 40));
        e4.setOpaque(true);
        e4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e4);

        f4.setBackground(new java.awt.Color(136, 136, 153));
        f4.setAlignmentY(0.0F);
        f4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f4.setDoubleBuffered(true);
        f4.setIconTextGap(0);
        f4.setMaximumSize(new java.awt.Dimension(40, 40));
        f4.setMinimumSize(new java.awt.Dimension(40, 40));
        f4.setOpaque(true);
        f4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f4);

        g4.setBackground(new java.awt.Color(255, 255, 255));
        g4.setAlignmentY(0.0F);
        g4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g4.setDoubleBuffered(true);
        g4.setIconTextGap(0);
        g4.setMaximumSize(new java.awt.Dimension(40, 40));
        g4.setMinimumSize(new java.awt.Dimension(40, 40));
        g4.setOpaque(true);
        g4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g4);

        h4.setBackground(new java.awt.Color(136, 136, 153));
        h4.setAlignmentY(0.0F);
        h4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h4.setDoubleBuffered(true);
        h4.setIconTextGap(0);
        h4.setMaximumSize(new java.awt.Dimension(40, 40));
        h4.setMinimumSize(new java.awt.Dimension(40, 40));
        h4.setOpaque(true);
        h4.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h4);

        a3.setBackground(new java.awt.Color(136, 136, 153));
        a3.setAlignmentY(0.0F);
        a3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a3.setDoubleBuffered(true);
        a3.setIconTextGap(0);
        a3.setMaximumSize(new java.awt.Dimension(40, 40));
        a3.setMinimumSize(new java.awt.Dimension(40, 40));
        a3.setOpaque(true);
        a3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a3);

        b3.setBackground(new java.awt.Color(255, 255, 255));
        b3.setAlignmentY(0.0F);
        b3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b3.setDoubleBuffered(true);
        b3.setIconTextGap(0);
        b3.setMaximumSize(new java.awt.Dimension(40, 40));
        b3.setMinimumSize(new java.awt.Dimension(40, 40));
        b3.setOpaque(true);
        b3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b3);

        c3.setBackground(new java.awt.Color(136, 136, 153));
        c3.setAlignmentY(0.0F);
        c3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c3.setDoubleBuffered(true);
        c3.setIconTextGap(0);
        c3.setMaximumSize(new java.awt.Dimension(40, 40));
        c3.setMinimumSize(new java.awt.Dimension(40, 40));
        c3.setOpaque(true);
        c3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c3);

        d3.setBackground(new java.awt.Color(255, 255, 255));
        d3.setAlignmentY(0.0F);
        d3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d3.setDoubleBuffered(true);
        d3.setIconTextGap(0);
        d3.setMaximumSize(new java.awt.Dimension(40, 40));
        d3.setMinimumSize(new java.awt.Dimension(40, 40));
        d3.setOpaque(true);
        d3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d3);

        e3.setBackground(new java.awt.Color(136, 136, 153));
        e3.setAlignmentY(0.0F);
        e3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e3.setDoubleBuffered(true);
        e3.setIconTextGap(0);
        e3.setMaximumSize(new java.awt.Dimension(40, 40));
        e3.setMinimumSize(new java.awt.Dimension(40, 40));
        e3.setOpaque(true);
        e3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e3);

        f3.setBackground(new java.awt.Color(255, 255, 255));
        f3.setAlignmentY(0.0F);
        f3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f3.setDoubleBuffered(true);
        f3.setIconTextGap(0);
        f3.setMaximumSize(new java.awt.Dimension(40, 40));
        f3.setMinimumSize(new java.awt.Dimension(40, 40));
        f3.setOpaque(true);
        f3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f3);

        g3.setBackground(new java.awt.Color(136, 136, 153));
        g3.setAlignmentY(0.0F);
        g3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g3.setDoubleBuffered(true);
        g3.setIconTextGap(0);
        g3.setMaximumSize(new java.awt.Dimension(40, 40));
        g3.setMinimumSize(new java.awt.Dimension(40, 40));
        g3.setOpaque(true);
        g3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g3);

        h3.setBackground(new java.awt.Color(255, 255, 255));
        h3.setAlignmentY(0.0F);
        h3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h3.setDoubleBuffered(true);
        h3.setIconTextGap(0);
        h3.setMaximumSize(new java.awt.Dimension(40, 40));
        h3.setMinimumSize(new java.awt.Dimension(40, 40));
        h3.setOpaque(true);
        h3.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h3);

        a2.setBackground(new java.awt.Color(255, 255, 255));
        a2.setAlignmentY(0.0F);
        a2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a2.setDoubleBuffered(true);
        a2.setIconTextGap(0);
        a2.setMaximumSize(new java.awt.Dimension(40, 40));
        a2.setMinimumSize(new java.awt.Dimension(40, 40));
        a2.setName("a2"); // NOI18N
        a2.setOpaque(true);
        a2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a2);

        b2.setBackground(new java.awt.Color(136, 136, 153));
        b2.setAlignmentY(0.0F);
        b2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b2.setDoubleBuffered(true);
        b2.setIconTextGap(0);
        b2.setMaximumSize(new java.awt.Dimension(40, 40));
        b2.setMinimumSize(new java.awt.Dimension(40, 40));
        b2.setName("b2"); // NOI18N
        b2.setOpaque(true);
        b2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b2);

        c2.setBackground(new java.awt.Color(255, 255, 255));
        c2.setAlignmentY(0.0F);
        c2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c2.setDoubleBuffered(true);
        c2.setIconTextGap(0);
        c2.setMaximumSize(new java.awt.Dimension(40, 40));
        c2.setMinimumSize(new java.awt.Dimension(40, 40));
        c2.setName("c2"); // NOI18N
        c2.setOpaque(true);
        c2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c2);

        d2.setBackground(new java.awt.Color(136, 136, 153));
        d2.setAlignmentY(0.0F);
        d2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d2.setDoubleBuffered(true);
        d2.setIconTextGap(0);
        d2.setMaximumSize(new java.awt.Dimension(40, 40));
        d2.setMinimumSize(new java.awt.Dimension(40, 40));
        d2.setName("d2"); // NOI18N
        d2.setOpaque(true);
        d2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d2);

        e2.setBackground(new java.awt.Color(255, 255, 255));
        e2.setAlignmentY(0.0F);
        e2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e2.setDoubleBuffered(true);
        e2.setIconTextGap(0);
        e2.setMaximumSize(new java.awt.Dimension(40, 40));
        e2.setMinimumSize(new java.awt.Dimension(40, 40));
        e2.setName("e2"); // NOI18N
        e2.setOpaque(true);
        e2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e2);

        f2.setBackground(new java.awt.Color(136, 136, 153));
        f2.setAlignmentY(0.0F);
        f2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f2.setDoubleBuffered(true);
        f2.setIconTextGap(0);
        f2.setMaximumSize(new java.awt.Dimension(40, 40));
        f2.setMinimumSize(new java.awt.Dimension(40, 40));
        f2.setName("f2"); // NOI18N
        f2.setOpaque(true);
        f2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f2);

        g2.setBackground(new java.awt.Color(255, 255, 255));
        g2.setAlignmentY(0.0F);
        g2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g2.setDoubleBuffered(true);
        g2.setIconTextGap(0);
        g2.setMaximumSize(new java.awt.Dimension(40, 40));
        g2.setMinimumSize(new java.awt.Dimension(40, 40));
        g2.setName("g2"); // NOI18N
        g2.setOpaque(true);
        g2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g2);

        h2.setBackground(new java.awt.Color(136, 136, 153));
        h2.setAlignmentY(0.0F);
        h2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h2.setDoubleBuffered(true);
        h2.setIconTextGap(0);
        h2.setMaximumSize(new java.awt.Dimension(40, 40));
        h2.setMinimumSize(new java.awt.Dimension(40, 40));
        h2.setName("h2"); // NOI18N
        h2.setOpaque(true);
        h2.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h2);

        a1.setBackground(new java.awt.Color(136, 136, 153));
        a1.setAlignmentY(0.0F);
        a1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        a1.setDoubleBuffered(true);
        a1.setIconTextGap(0);
        a1.setMaximumSize(new java.awt.Dimension(40, 40));
        a1.setMinimumSize(new java.awt.Dimension(40, 40));
        a1.setName("a1"); // NOI18N
        a1.setOpaque(true);
        a1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(a1);
        a1.getAccessibleContext().setAccessibleName("a1");

        b1.setBackground(new java.awt.Color(255, 255, 255));
        b1.setAlignmentY(0.0F);
        b1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        b1.setDoubleBuffered(true);
        b1.setIconTextGap(0);
        b1.setMaximumSize(new java.awt.Dimension(40, 40));
        b1.setMinimumSize(new java.awt.Dimension(40, 40));
        b1.setName("b1"); // NOI18N
        b1.setOpaque(true);
        b1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(b1);

        c1.setBackground(new java.awt.Color(136, 136, 153));
        c1.setAlignmentY(0.0F);
        c1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        c1.setDoubleBuffered(true);
        c1.setIconTextGap(0);
        c1.setMaximumSize(new java.awt.Dimension(40, 40));
        c1.setMinimumSize(new java.awt.Dimension(40, 40));
        c1.setName("c1"); // NOI18N
        c1.setOpaque(true);
        c1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(c1);

        d1.setBackground(new java.awt.Color(255, 255, 255));
        d1.setAlignmentY(0.0F);
        d1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        d1.setDoubleBuffered(true);
        d1.setIconTextGap(0);
        d1.setMaximumSize(new java.awt.Dimension(40, 40));
        d1.setMinimumSize(new java.awt.Dimension(40, 40));
        d1.setName("d1"); // NOI18N
        d1.setOpaque(true);
        d1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(d1);

        e1.setBackground(new java.awt.Color(136, 136, 153));
        e1.setAlignmentY(0.0F);
        e1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        e1.setDoubleBuffered(true);
        e1.setIconTextGap(0);
        e1.setMaximumSize(new java.awt.Dimension(40, 40));
        e1.setMinimumSize(new java.awt.Dimension(40, 40));
        e1.setName("e1"); // NOI18N
        e1.setOpaque(true);
        e1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(e1);

        f1.setBackground(new java.awt.Color(255, 255, 255));
        f1.setAlignmentY(0.0F);
        f1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        f1.setDoubleBuffered(true);
        f1.setIconTextGap(0);
        f1.setMaximumSize(new java.awt.Dimension(40, 40));
        f1.setMinimumSize(new java.awt.Dimension(40, 40));
        f1.setName("f1"); // NOI18N
        f1.setOpaque(true);
        f1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(f1);

        g1.setBackground(new java.awt.Color(136, 136, 153));
        g1.setAlignmentY(0.0F);
        g1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        g1.setDoubleBuffered(true);
        g1.setIconTextGap(0);
        g1.setMaximumSize(new java.awt.Dimension(40, 40));
        g1.setMinimumSize(new java.awt.Dimension(40, 40));
        g1.setName("g1"); // NOI18N
        g1.setOpaque(true);
        g1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(g1);

        h1.setBackground(new java.awt.Color(255, 255, 255));
        h1.setAlignmentY(0.0F);
        h1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        h1.setDoubleBuffered(true);
        h1.setIconTextGap(0);
        h1.setMaximumSize(new java.awt.Dimension(40, 40));
        h1.setMinimumSize(new java.awt.Dimension(40, 40));
        h1.setName("h1"); // NOI18N
        h1.setOpaque(true);
        h1.setPreferredSize(new java.awt.Dimension(40, 40));
        echiquierpanel.add(h1);

        logbox.setColumns(20);
        logbox.setLineWrap(true);
        logbox.setRows(5);
        jScrollPane1.setViewportView(logbox);

        a.setFont(new java.awt.Font("Tahoma", 1, 12));
        a.setText("a");

        rg1.setFont(new java.awt.Font("Tahoma", 1, 12));
        rg1.setText("1");

        rg8.setFont(new java.awt.Font("Tahoma", 1, 12));
        rg8.setText("8");

        h.setFont(new java.awt.Font("Tahoma", 1, 12));
        h.setText("h");

        Quit.setFont(new java.awt.Font("Tahoma", 1, 11));
        Quit.setText("Quit");
        Quit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                QuitActionPerformed(evt);
            }
        });

        nextPiece.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        nextPiece.setText("next");
        nextPiece.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextPieceActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(rg8)
                    .addComponent(rg1, javax.swing.GroupLayout.DEFAULT_SIZE, 8, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(echiquierpanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(a, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 257, Short.MAX_VALUE)
                        .addComponent(h, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(20, 20, 20)))
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(Quit)
                        .addGap(12, 12, 12))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(nextPiece)
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(13, 13, 13)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(Quit)
                        .addGap(30, 30, 30)
                        .addComponent(nextPiece))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(echiquierpanel, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(a)
                            .addComponent(h, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addComponent(rg8)
                        .addGap(247, 247, 247)
                        .addComponent(rg1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-443)/2, (screenSize.height-522)/2, 443, 522);
    }// </editor-fold>//GEN-END:initComponents

    private void QuitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_QuitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_QuitActionPerformed

    private void echiquierpanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_echiquierpanelMouseClicked
        Clic(evt);
}//GEN-LAST:event_echiquierpanelMouseClicked
    private void Clic(MouseEvent evt)
    {
//        int X = evt.getX();
//        int Y = evt.getY();
//        System.out.print(X + " - ");
//        System.out.print(Y + " - ");
//        System.out.println(echiquierpanel.getComponentAt(X, Y));
    }
    private void nextPieceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextPieceActionPerformed
        clicNextPiece();
    }//GEN-LAST:event_nextPieceActionPerformed

    private void clicNextPiece()
    {
        nettoyeBoards();
        Entry<APiece, Case> entree;
        if (itPiece.hasNext()) {
            entree = itPiece.next();
            Case _case = entree.getValue();
            int X = (_case.getX().intValue() - 2) * 40 + 20;
            int Y = (9 - _case.getY().intValue()) * 40 + 20;
            jlabel = (JLabel) echiquierpanel.getComponentAt(X, Y);
            jlabel.setBorder(javax.swing.BorderFactory.createLineBorder(
                    new java.awt.Color(7, 7, 200), 2));
            APiece _piece = entree.getKey();
            afficheCoups(_piece);
        } else {
            itPiece = position.getPos_courante().iterator();
        }
    }

    private void afficheCoups(APiece _piece)
    {
        Liste<Coups> liste = _piece.getListcoupspiece();
        for (Coups coups : liste.getInstance()) {
            Case _case = coups.getArrivee();
            int X = (_case.getX().intValue() - 2) * 40 + 20;
            int Y = (9 - _case.getY().intValue()) * 40 + 20;
            jlabel = (JLabel) echiquierpanel.getComponentAt(X, Y);
            jlabel.setBorder(javax.swing.BorderFactory.createLineBorder(
                    new java.awt.Color(200, 7, 7), 3));
        }
    }

    private void nettoyeBoards()
    {
        Case _case;
        for (int y = 2; y < 10; y++) {
            for (int x = 2; x < 10; x++) {
                _case = Case.getLCASES(x,y);
                int X = (_case.getX().intValue() - 2) * 40 + 20;
                int Y = (9 - _case.getY().intValue()) * 40 + 20;
                JLabel label = (JLabel) echiquierpanel.getComponentAt(X, Y);
                label.setBorder(javax.swing.BorderFactory.createLineBorder(
                        new java.awt.Color(0, 0, 0), 1));
            }
        }
    }

    private void toGui()
    {
        Iterator<Entry<APiece, Case>> it = position.getPos_courante().iterator();
        Entry<APiece, Case> entree;
        APiece piece;
        Case _case;

        while (it.hasNext()) {
            entree = it.next();
            piece = entree.getKey();
            _case = entree.getValue();
            toGui(piece, _case);
        }
    }

    private void toGui(APiece piece, Case _case)
    {
        String pieceStr = "";
        pieceStr += piece.couleur.equals(Couleur.blanc) ? "w" : "b";
        pieceStr += piece.nom;
        int X = (_case.getX().intValue() - 2) * 40 + 20;
        int Y = (9 - _case.getY().intValue()) * 40 + 20;
        JLabel jlabel = (JLabel) echiquierpanel.getComponentAt(X, Y);
        pieceStr += jlabel.getBackground().equals(jlwhite) ? "w" : "b";
        URL labelUrl = getClass().getResource("/pieces/" + pieceStr + ".gif");
        jlabel.setIcon(new ImageIcon(labelUrl));
    }

    private void positionInitiale()
    {
        a1.setIcon(new ImageIcon(wrb));
        b1.setIcon(new ImageIcon(wnw));
        c1.setIcon(new ImageIcon(wbb));
        d1.setIcon(new ImageIcon(wqw));
        e1.setIcon(new ImageIcon(wkb));
        f1.setIcon(new ImageIcon(wbw));
        g1.setIcon(new ImageIcon(wnb));
        h1.setIcon(new ImageIcon(wrw));
        a2.setIcon(new ImageIcon(wpw));
        b2.setIcon(new ImageIcon(wpb));
        c2.setIcon(new ImageIcon(wpw));
        d2.setIcon(new ImageIcon(wpb));
        e2.setIcon(new ImageIcon(wpw));
        f2.setIcon(new ImageIcon(wpb));
        g2.setIcon(new ImageIcon(wpw));
        h2.setIcon(new ImageIcon(wpb));
        a8.setIcon(new ImageIcon(brw));
        b8.setIcon(new ImageIcon(bnb));
        c8.setIcon(new ImageIcon(bbw));
        d8.setIcon(new ImageIcon(bqb));
        e8.setIcon(new ImageIcon(bkw));
        f8.setIcon(new ImageIcon(bbb));
        g8.setIcon(new ImageIcon(bnw));
        h8.setIcon(new ImageIcon(brb));
        a7.setIcon(new ImageIcon(bpb));
        b7.setIcon(new ImageIcon(bpw));
        c7.setIcon(new ImageIcon(bpb));
        d7.setIcon(new ImageIcon(bpw));
        e7.setIcon(new ImageIcon(bpb));
        f7.setIcon(new ImageIcon(bpw));
        g7.setIcon(new ImageIcon(bpb));
        h7.setIcon(new ImageIcon(bpw));
    }

    private void initialiserURL()
    {

        W = getClass().getResource("/pieces/w.gif");
        B = getClass().getResource("/pieces/b.gif");

        wrb = getClass().getResource("/pieces/wrb.gif");
        wrw = getClass().getResource("/pieces/wrw.gif");

        wnw = getClass().getResource("/pieces/wnw.gif");
        wnb = getClass().getResource("/pieces/wnb.gif");

        wbb = getClass().getResource("/pieces/wbb.gif");
        wbw = getClass().getResource("/pieces/wbw.gif");

        wqw = getClass().getResource("/pieces/wqw.gif");
        wqb = getClass().getResource("/pieces/wqb.gif");

        wpw = getClass().getResource("/pieces/wpw.gif");
        wpb = getClass().getResource("/pieces/wpb.gif");

        wkw = getClass().getResource("/pieces/wkw.gif");
        wkb = getClass().getResource("/pieces/wkb.gif");

        brb = getClass().getResource("/pieces/brb.gif");
        brw = getClass().getResource("/pieces/brw.gif");

        bnw = getClass().getResource("/pieces/bnw.gif");
        bnb = getClass().getResource("/pieces/bnb.gif");

        bbb = getClass().getResource("/pieces/bbb.gif");
        bbw = getClass().getResource("/pieces/bbw.gif");

        bqw = getClass().getResource("/pieces/bqw.gif");
        bqb = getClass().getResource("/pieces/bqb.gif");

        bpw = getClass().getResource("/pieces/bpw.gif");
        bpb = getClass().getResource("/pieces/bpb.gif");

        bkw = getClass().getResource("/pieces/bkw.gif");
        bkb = getClass().getResource("/pieces/bkb.gif");





    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Quit;
    private javax.swing.JLabel a;
    private javax.swing.JLabel a1;
    private javax.swing.JLabel a2;
    private javax.swing.JLabel a3;
    private javax.swing.JLabel a4;
    private javax.swing.JLabel a5;
    private javax.swing.JLabel a6;
    private javax.swing.JLabel a7;
    private javax.swing.JLabel a8;
    private javax.swing.JLabel b1;
    private javax.swing.JLabel b2;
    private javax.swing.JLabel b3;
    private javax.swing.JLabel b4;
    private javax.swing.JLabel b5;
    private javax.swing.JLabel b6;
    private javax.swing.JLabel b7;
    private javax.swing.JLabel b8;
    private javax.swing.JLabel c1;
    private javax.swing.JLabel c2;
    private javax.swing.JLabel c3;
    private javax.swing.JLabel c4;
    private javax.swing.JLabel c5;
    private javax.swing.JLabel c6;
    private javax.swing.JLabel c7;
    private javax.swing.JLabel c8;
    private javax.swing.JLabel d1;
    private javax.swing.JLabel d2;
    private javax.swing.JLabel d3;
    private javax.swing.JLabel d4;
    private javax.swing.JLabel d5;
    private javax.swing.JLabel d6;
    private javax.swing.JLabel d7;
    private javax.swing.JLabel d8;
    private javax.swing.JLabel e1;
    private javax.swing.JLabel e2;
    private javax.swing.JLabel e3;
    private javax.swing.JLabel e4;
    private javax.swing.JLabel e5;
    private javax.swing.JLabel e6;
    private javax.swing.JLabel e7;
    private javax.swing.JLabel e8;
    public javax.swing.JPanel echiquierpanel;
    private javax.swing.JLabel f1;
    private javax.swing.JLabel f2;
    private javax.swing.JLabel f3;
    private javax.swing.JLabel f4;
    private javax.swing.JLabel f5;
    private javax.swing.JLabel f6;
    private javax.swing.JLabel f7;
    private javax.swing.JLabel f8;
    private javax.swing.JLabel g1;
    private javax.swing.JLabel g2;
    private javax.swing.JLabel g3;
    private javax.swing.JLabel g4;
    private javax.swing.JLabel g5;
    private javax.swing.JLabel g6;
    private javax.swing.JLabel g7;
    private javax.swing.JLabel g8;
    private javax.swing.JLabel h;
    private javax.swing.JLabel h1;
    private javax.swing.JLabel h2;
    private javax.swing.JLabel h3;
    private javax.swing.JLabel h4;
    private javax.swing.JLabel h5;
    private javax.swing.JLabel h6;
    private javax.swing.JLabel h7;
    private javax.swing.JLabel h8;
    public javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea logbox;
    private javax.swing.JButton nextPiece;
    private javax.swing.JLabel rg1;
    private javax.swing.JLabel rg8;
    // End of variables declaration//GEN-END:variables
}



